import { createRouter, createWebHashHistory } from "vue-router";
// import constants from "./constants";
const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: "/index",
    name: "index",
    meta: {
      title: "主页",
    },
    component: () => import(/* webpackChunkName: "main" */ "@/views/index"),
  },
  {
    path: '/content',
    name: "content",
    meta: {
      title: '内容',
    },
    props: true,
    component: () => import(/* webpackChunkName: "main" */ "@/views/content")
  },
  {
    path: "/:catchAll(.*)",
    name: "404",
    component: () =>
      import(/* webpackChunkName: "404" */ "@/views/error/404.vue"),
    meta: {
      title: "404",
    },
  },
];
const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes,
});
export default router;
